<?php
require_once "../tools/DbTools.php";

$accountCode = $_POST["AccountCode"];
$accountPhone = $_POST["AccountPhone"];
$realName = $_POST["RealName"];

if (empty($accountCode)||empty($accountPhone)||empty($realName)){
    exit("请填写完整信息,<a href='createAccount.html'>返回开户页面</a>");
}

DbTools::InitDb();
$sql="INSERT into accountinfo(AccountCode,AccountPhone,RealName,OpenTime) VALUES('$accountCode','$accountPhone','$realName',NOW())";
$result = DbTools::noSelect($sql);
if (!$result["status"]){
    exit("开户失败,<a href='createAccount.html'>返回开户页面</a>");
}
echo "开户成功,<a href='main.html'>返回后台</a>";
DbTools::close();
